Date.prototype.format = function (format = "yy-MM-dd HH:mm:ss") {
  var o = {
    "y+": this.getFullYear(),
    "M+": this.getMonth() + 1,
    "d+": this.getDate(),
    "H+": this.getHours(),
    "m+": this.getMinutes(),
    "s+": this.getSeconds(),
    S: this.getMilliseconds(),
  };
  for (var k in o) {
    var reg = new RegExp("(" + k + ")");
    if (reg.test(format)) {
      var v = o[k] + "";
      if (v.length == 1 && RegExp.$1.length < 4 && RegExp.$1.length > 1)
        v = "0" + v;
      format = format.replace(reg, v);
    }
  }
  return format;
};

String.prototype.capitalize = function () {
  return this.charAt(0).toUpperCase() + this.substring(1);
};
